﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using K9Nano.Domain;

namespace K9Nano.Admin.Data
{
    /// <summary>
    /// 微信公众号登录绑定关系表
    /// </summary>
    [Table("AppUserWeixinLogin")]
    public class UserWeixinLogin: Entity
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        [Required]
        public Guid UserId { get; set; }

        /// <summary>
        /// 公众号App ID
        /// </summary>
        [Required]
        [StringLength(50)]
        public string AppId { get; set; }

        /// <summary>
        /// 公众号通用ID
        /// </summary>
        [StringLength(50)]
        public string UnionId { get; set; }

        /// <summary>
        /// 公众号 OpenID
        /// </summary>
        [Required]
        [StringLength(50)]
        public string OpenId { get; set; }

        /// <summary>
        /// 客户端ID
        /// </summary>
        [Required]
        public string ClientId { get; set; }

        /// <summary>
        /// 绑定时间
        /// </summary>
        [Required]
        public DateTimeOffset CreationTime { get; set; }
    }
}